<template>
  <div id="app">
    <router-view />
  </div>
</template>



<style lang="scss">
@import '../resource/scss/config.scss';
@import '../resource/scss/reset.scss';
@import 'assets/scss/button.scss';
@import 'assets/scss/base.scss';
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
* {
  margin: 0;
  padding: 0;
}
</style>


<script>
export default {
  data() {
    return {}
  },
  mounted() {
    // console.log(this.$store)
    // console.log(this)
    this.getUser()
  },
  methods: {
    // 此接口用于保存vuex的状态
    async getUser() {
      let res = await this.axios.get('user')

      // console.log(res)
      if (!res) return
      this.$store.dispatch('changeUsername', res.username)
    },
  },
}
</script>